"""
filter()
filter(function or None, iterable) --> filter object

    Return an iterator yielding those items of iterable for which function(item)
    is true. If function is None, return the items that are true

"""
list1 = [1, 2, 3, 0, 10, 0, 25]
# 遍历列表中不为0的元素
for i in list1:
    if i != 0:
        print(i, end=' ')
print()
# it1 = filter(None,list1)
# for i in it1:
#     print(i,end=' ')

# it1 = filter(lambda x:x != 0,list1)
# for i in it1:
#     print(i,end=' ')
it1 = filter(lambda x: x >= 5, list1)
for i in it1:
    print(i, end=' ')
